package com.example.demo.Mapper;

import com.example.demo.Moudule.Userinfo;
import org.apache.catalina.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface UserMapper {
        //无参数的查询
        public List<Userinfo> getAll();

        //有参数的查询
        public Userinfo getUserById(@Param("id") Integer i);

        //插入一条记录
        public int insertUser(Userinfo userinfo);

        //记录的排序
        public List<Userinfo> orderRecord(@Param("order") String order);

        //SQL注入
        public List<Userinfo> sqlProblem(@Param("s1") String name,
                                         @Param("s2") String password);

        //like模糊查询
        public List<Userinfo> likeSql(@Param("s") String s);

        //使用if标签插入
        public int ifTagInsert(@Param("username") String username,
                               @Param("password") String password,
                                @Param("photo") String photo);

}
